package com.yang.concurrency.chapter2;

/**
 * @Author: 血魔
 * @Date: Created in 12:49 2021/12/12
 * @Version: 1.0$
 */
public class TicketWindowRunnable implements Runnable {
    private int index = 0;
    private final static int MAX = 50;

    public void run() {
        while (index<=MAX){
            try{
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + " 的号码是：" + (index++));
        }
    }
}
